home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 1.7 KB | 55 lines | [TEXT/ttxt] |
- <<<
- global win := new window boundary:(new rect x2:200 y2:200) centered:true
-
- function makeButton label ->
- (
- local relPres := new TextPresenter boundary: (new rect x2:100 y2:20) \
- target:label \
- fill:whiteBrush \
- stroke:blackBrush
- relPres.inset := new Point x:4 y:2
- local prsPres := new TextPresenter boundary: (new rect x2:100 y2:20) \
- target:label \
- fill:blackBrush \
- stroke:blackBrush
- prsPres.inset := new Point x:4 y:2
-
- local button := new PushButton
- button.releasedpresenter := relPres
- button.pressedpresenter := prsPres
- button.activateAction := (authordata self -> print label)
-
- return button
- )
-
- -- Defined pushbuttons
- global menuButton := (makeButton "MAIN")
- global menuItem1 := (makeButton "menuItem1")
- global menuItem2 := (makeButton "menuItem2")
- global menuItem3 := (makeButton "menuItem3")
-
- global submenuButton := (makeButton "SUBMENU")
- global submenuItem1 := (makeButton "submenuItem1")
- global submenuItem2 := (makeButton "submenuItem2")
- global submenuItem3 := (makeButton "submenuItem3")
-
- -- Define menus
- global mainmenu := new menu placement:@menuDown
- append mainmenu menuItem1
- append mainmenu menuItem2
- append mainmenu menuItem3
- append mainmenu submenuButton
-
- global submenu := new menu placement:@menuRight
- append submenu submenuItem1
- append submenu submenuItem2
- append submenu submenuItem3
-
- submenuButton.menu := submenu
- menuButton.menu := mainmenu
-
- append win menuButton
- show win
-
- global ac := new ActuatorController space:win wholespace:true
- >>>